package com.blockmeta.bbs.minemodule.activity;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.blockmeta.bbs.baselibrary.base.adapter.BaseTabViewPagerAdapter;
import com.blockmeta.bbs.baselibrary.widget.tab.SlidingTabLayout;
import com.blockmeta.bbs.businesslibrary.arouter.RouterPath;
import com.blockmeta.bbs.businesslibrary.base.BaseActivity;
import com.blockmeta.bbs.businesslibrary.constant.Constant;
import com.blockmeta.bbs.minemodule.R;
import com.blockmeta.bbs.minemodule.R2;
import com.blockmeta.bbs.minemodule.fragment.MyActiveListFragment;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.OnClick;
@Route(path = RouterPath.MY_ACTIVE_ACTIVITY)
public class MyActiveActivity extends BaseActivity {
    @BindView(R2.id.tab)
    SlidingTabLayout mTab;
    @BindView(R2.id.vp_container)
    ViewPager mVpContainer;

    @Autowired(name = Constant.ZERO)
    public int mWhichTab;
    @Override
    protected boolean showTitle() {
        return false;
    }

    @Override
    public View setView() {
        return getLayoutInflater().inflate(R.layout.activity_my_active, null);
    }

    @Override
    protected void initialize() {
        super.initialize();
        ArrayList<String> tabs = new ArrayList<>(4);
        tabs.add("报名成功");
        tabs.add("审核中");
        ArrayList<Fragment> fragments = new ArrayList<>(4);
        fragments.add(MyActiveListFragment.instance("",""));
        fragments.add(MyActiveListFragment.instance("type","checking"));

        mVpContainer.setAdapter(new BaseTabViewPagerAdapter(getSupportFragmentManager(),fragments,tabs));
        mTab.setViewPager(mVpContainer);

        mVpContainer.setCurrentItem(mWhichTab);
    }

    @OnClick(R2.id.ll_back)
    public void onViewClicked() {
        finish();
    }
}
